<?php
$tb=array("drug","user","history","drug_history","hospital","test");
$tbn=5;
$table=$tb[$tbn];
function D($a){
	include "db2.php";
	return $db_mssql[$a];
}
$my_con=mssql_connect('172.168.5.79','scmp','scmp');
if(!$my_con){
		die('无法连接');
	}
mssql_select_db(D('DB_NAME'),$my_con);
//取得表字段名
$query="SELECT * from ".D('DB_PREFIX').$table;
$result=mssql_query($query,$my_con);
$num=mssql_num_rows($result);
for($i=0;$i<$num;$i++){
	$row=mssql_fetch_array($result);
	echo $row[$i]."<br/>";
}
?>